<script type="text/javascript" src="<?=base_url()?>public/js/clipboard.min.js"></script>
<script language="javascript" src="http://dkb.duokebo.com/js/detector.aspx?siteid=646422&float=0&m=1"></script>
<style>
body{background-color:#000;}
    .alertBox{
            display: none;
            font-size: 15px;
            width: 300px;
            height: 120px;
            position: absolute;
            top: 50%;
            left: 50%;
            z-index: 999999;
            font-family: "微软雅黑";
            transform: translate(-150px,-60px);
            background-color: #fff;
            box-shadow: 0px 0px 2px 2px #efefef;
        }
		.alertBox1{
            display: none;
            font-size: 15px;
            width: 300px;
            height: 120px;
            position: absolute;
            top: 50%;
            left: 50%;
            z-index: 999999;
            font-family: "微软雅黑";
            transform: translate(-150px,-60px);
            background-color: #fff;
            box-shadow: 0px 0px 2px 2px #efefef;
        }
        .alertBox>b{
            position: absolute;
            right: 8px;
            top: 3px;
            font-size: 22px;
            color: #000;
            transform: scaleY(0.72);
        }
		.alertBox1>b{
            position: absolute;
            right: 8px;
            top: 3px;
            font-size: 22px;
            color: #000;
            transform: scaleY(0.72);
        }
        .alertBox>p{
             margin-top: 30px;
            text-align: center;
            color: #000;
        }
		.alertBox1>p{
             margin-top: 30px;
            text-align: center;
            color: #000;
        }
        .alertBox>.confirmBtn{
            position: absolute;
            width: 80%;
            bottom: 10px;
            right: 10%;
            
        }
		.alertBox1>.confirmBtn{
            position: absolute;
            width: 80%;
            bottom: 10px;
            right: 10%;
            
        }
        .alertBox>.confirmBtn>.confirm{
            float: left;
            left: 0px;
           

        }
        .alertBox>.confirmBtn>.cancel{
            float: right;
        }
       .alertBox>.confirmBtn>button{

            outline: none;
            border:none; 
            width:100px;
            height:28px;
               background-color: #000;
            cursor: pointer;
             box-shadow: 0px 0px 1px 1px rgba( 11, 2, 5, 0.2 );
               color: #fff; 


        }
		.alertBox1>.confirmBtn>.confirm{
           margin-left:30%;
           

        }
        .alertBox1>.confirmBtn>.cancel{
            float: right;
        }
       .alertBox1>.confirmBtn>button{

            outline: none;
            border:none; 
            width:100px;
            height:28px;
               background-color: #000;
            cursor: pointer;
             box-shadow: 0px 0px 1px 1px rgba( 11, 2, 5, 0.2 );
               color: #fff; 
			margin-left:30%;

        }
		.logo b .button{
			float:right;
			margin-left:10px;
			background:#000;
			color:white;
			display:block;
			height:20px;
			line-height:20px;
			margin-top:-2px;
			border-radius:20px;
			padding:0 12px;
		}
		.logo b .button:hover{
			background:white;
			color:black;
		}
}
</style>
<div class="header">
	<div class="logo">
    	<div class="left">
    	<img src="<?=base_url()?>public/img/logo.png" />
        <span>公益扶农合作平台</span>
        </div>
		
		<b>推广链接：<em id="foo" class='url' data-clipboard-text="http://www.dedaotianhe.com/reg/index/1">
		http://www.dedaotianhe.com/reg/index/<?php echo $_SESSION ['user'] ['id'];?></em><a class="button copy" data-clipboard-action="copy" data-clipboard-target="#foo" >复制链接</a></b><!-- onClick='copyToClipBoard("http://www.dedaotianhe.com/reg/index/<?php // echo $_SESSION ['user'] ['id'];?>")' -->
		<textarea cols='20' ows='10' id='biao1' style='height:0;width:0;opacity:0;'></textarea>
		
	<script>
        //复制到剪切板js代码
        function copyToClipBoard(s) {
            //alert(s);
            if (window.clipboardData) {
                window.clipboardData.setData("Text", s);
                alert("已经复制到剪切板！"+ "\n" + s);
            } else if (navigator.userAgent.indexOf("Opera") != -1) {
                window.location = s;
            } else if (window.netscape) {
                try {
                    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                } catch (e) {
                    alert("被浏览器拒绝！\n请在浏览器地址栏输入'about:config'并回车\n然后将'signed.applets.codebase_principal_support'设置为'true'");
                }
                var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
                if (!clip)
                    return;
                var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
                if (!trans)
                    return;
                trans.addDataFlavor('text/unicode');
                var str = new Object();
                var len = new Object();
                var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
                var copytext = s;
                str.data = copytext;
                trans.setTransferData("text/unicode", str, copytext.length * 2);
                var clipid = Components.interfaces.nsIClipboard;
                if (!clip)
                    return false;
                clip.setData(trans, null, clipid.kGlobalClipboard);
                alert("已经复制到剪切板！" + "\n" + s)
            }
        }
		</script>
		
        <ul>
        	<li class="youjian"><a href="mail" style='color:blue;'>系统邮件</a></li>
            <li id="btn_logout" class="tuichu"><a href="javascript:void(0)">退出系统</a></li>
          
        </ul> 
    </div>
</div>
<div class="alertBox" > 
          <b>X</b>
          <p>您确定要退出平台吗？</p>
        <div class="confirmBtn">
            <button class="confirm">确认</button>
            <button class="cancel" >取消</button>
        </div>
</div>
<div class="alertBox1" > 
          <p></p>
        <div class="confirmBtn">
            <button class='can'>确认</button>
        </div>
</div>
  <script type="text/javascript">
                //退出登录
    $('#btn_logout').on('click',  function(event) {
        $(".alertBox").show();
    });
    $(".alertBox .cancel").click(function(){
           $(".alertBox").hide();
    });
     $(".alertBox>b").on("click",function(){
           $(".alertBox").hide();
    });
     $(".alertBox .confirm").click(function(){
             window.location.href="<?php echo site_url('login/logout'); ?>";
        });
		// 改alert弹窗
	$(".alertBox1 .can").click(function(){
           $(".alertBox1").hide();
    });
</script>

<script>

        /************这段代码不要动   抄就行**********/
    $(".header .button").click(function(event){
            event.preventDefault();
    });
       var clipboard = new Clipboard('.button');

    clipboard.on('success', function(e) {
        alert("复制成功");
    });

    clipboard.on('error', function(e) {
         alert("复制失败，请稍后重试.");
    });
    </script>